using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;

public class TestNav : MonoBehaviour
{

    NavMeshAgent _agent;

    public Transform Traget;

    const float _stopDis = 0.1f;

    // Start is called before the first frame update
    void Start()
    {
        _agent = gameObject.AddComponent<NavMeshAgent>();

        _agent.stoppingDistance = _stopDis;

        _agent.SetDestination(Traget.position);

    }

    // Update is called once per frame
    void Update()
    {
        if (Vector3.Distance(transform.position, Traget.transform.position) < _stopDis)
        {

        }
    }
}
